package view.console;

import java.util.ArrayList;
import java.util.Iterator;
import model.Album;
import model.AlbumModel;
import model.Model;

/**
 * Class for view an Album-information
 */
public class AlbumView implements ItemView {

    private Model albums = new AlbumModel();

    public Model getModel() {
        return albums;
    }

    public void showItems(ArrayList items) {
        if (items.size() == 0) {
            System.out.println("Не найдено ни одного альбома");
            return;
        }
        System.out.println("№\tАльбом");
        Iterator it = items.iterator();
        int i = 1;
        while (it.hasNext()) {
            System.out.println(i + "\t" + (Album) it.next());
            i++;
        }
        System.out.println("--------------------------------------------------");
    }

}
